
<?php
$this->breadcrumbs=array(
	'Access Role'=>array('index'),
	'Assignments',
);

?>
<div class="col-xs-10">
	<div class="page-content">
		<div class="page-header">
			<div class="clearfix">
				<div class="pull-left">
					<h1>
						<h1><?php echo Rights::t('core', 'Assignments'); ?></h1>
					</h1>
				</div>
				<div class="pull-right">
					<div class="btn-toolbar inline middle no-margin">
						<div class="btn-group">
							<a title="Assignments" href="<?php echo Yii::app()->createUrl('rights/assignment/view'); ?>" class="btn btn-sm "><i class="icon-file"></i>&nbsp;&nbsp;Assignments</a>
							<a title="Permissions" href="<?php echo Yii::app()->createUrl('rights/authItem/permissions'); ?>" class="btn btn-sm "><i class="icon-file"></i>&nbsp;&nbsp;Permissions</a>
							<a title="Roles" href="<?php echo Yii::app()->createUrl('rights/authItem/roles'); ?>" class="btn btn-sm "><i class="icon-file"></i>&nbsp;&nbsp;Roles</a>
							<a title="Tasks" href="<?php echo Yii::app()->createUrl('rights/authItem/tasks'); ?>" class="btn btn-sm "><i class="icon-file"></i>&nbsp;&nbsp;Tasks</a>
							<a title="Operations" href="<?php echo Yii::app()->createUrl('rights/authItem/operations'); ?>" class="btn btn-sm "><i class="icon-file"></i>&nbsp;&nbsp;Operations</a>
						</div>
					</div>
				</div>
			</div>
		</div>
		
		<div class="col-xs-12">
			<div class="widget-box">
				<div class="widget-header header-color-blue">
					<h5 class="bigger lighter">
						<i class="icon-table"></i>
						Assignments table (<?php echo Rights::t('core', 'Here you can view which permissions has been assigned to each user'); ?>).
					</h5>
				</div>

				<div class="widget-body">
					<div class="widget-main no-padding">
						<?php $this->widget('bootstrap.widgets.TbGridView', array(
							'dataProvider'=>$dataProvider,
							'type'=>'striped bordered condensed',
							'template'=>"{items}\n{pager}",
							'emptyText'=>Rights::t('core', 'No users found.'),
							'htmlOptions'=>array('class'=>'grid-view assignment-table'),
							'columns'=>array(
								array(
									'name'=>'name',
									'header'=>Rights::t('core', 'Name'),
									'type'=>'raw',
									'htmlOptions'=>array('class'=>'name-column'),
									'value'=>'$data->getAssignmentNameLink()',
								),
								array(
									'name'=>'assignments',
									'header'=>Rights::t('core', 'Roles'),
									'type'=>'raw',
									'htmlOptions'=>array('class'=>'role-column'),
									'value'=>'$data->getAssignmentsText(CAuthItem::TYPE_ROLE)',
								),
								array(
									'name'=>'assignments',
									'header'=>Rights::t('core', 'Tasks'),
									'type'=>'raw',
									'htmlOptions'=>array('class'=>'task-column'),
									'value'=>'$data->getAssignmentsText(CAuthItem::TYPE_TASK)',
								),
								array(
									'name'=>'assignments',
									'header'=>Rights::t('core', 'Operations'),
									'type'=>'raw',
									'htmlOptions'=>array('class'=>'operation-column'),
									'value'=>'$data->getAssignmentsText(CAuthItem::TYPE_OPERATION)',
								),
							)
						)); ?>
					</div>
				</div>
			</div>
		</div><!-- /span -->
		
	</div>
</div>

<?php 
	// echo TbHtml::breadcrumbs(array(
    // 'Rights'=>Rights::getBaseUrl(),
    // Rights::t('core', 'Assignments'),
	// )); 
?>

<script>
	$('.id-5').addClass('active');	
	$('.id-5').addClass('open');	
	$('.id-16').addClass('open');	
	$('.id-18').addClass('active');	
</script>